
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
		String path = request.getContextPath();
		String basePath = request.getScheme() + "://" + request.getServerName()
				+ ":" + request.getServerPort() + path + "/";
%>
 <%@ taglib prefix="ww" uri="webwork" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>人员管理</title>
<LINK href="./css/style.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #5CB7FE;
}
.STYLE1 {font-size: 12px}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
.STYLE8 {
	font-size: 16px;
	font-weight: bold;
}
-->
 </style>
<link href="../css/style.css" rel="stylesheet" type="text/css">
<script src="/dtree.js" type="text/javascript"></script>
<link href="/dtree.css" rel="stylesheet" type="text/css">
</head>
<script language="javascript">
function checkForm()
{
	var flag = 0;	
	for(i=0;i<document.all.userid.length;i++){
		if(document.all.userid[i].checked == true){			
			flag = 1;
		}
	}
	if(flag == 1){
		var count=0;
		for(var j=0; i<document.all.rights.length; j++){
			if(document.all.rights[j].checked){
				++count;
			}
		}
		if(count==0)
		{
			alert('请选择至少一个模块');
			return false;
		}
		return true;
	}else{
		alert('请选择一个要授权的用户');
		return false;	
	}
}
function init(obj){	
	for(i=0; i<document.all.userid.length; i++)
	{		
		if(document.all.userid[i].value == obj)
		{				
			form.userid[i].checked = true;
		}
	}
}
</script>
<body style="overflow-x:hidden" onload="init(<ww:property value="empid"/>)">
<ww:property value="msg"/>
<FORM name="form" method="post" action="rightsAddOrUpdate.action?flag=update" onSubmit="return checkForm()">
<table width="844" height="472" border="0" align="center" cellpadding="0"
	cellspacing="0" bordercolor="#D8EDFF">
	<!--DWLayoutTable-->
	<tr>
		<td height="8" colspan="4" valign="top"></td>
		<td width="834" valign="top"></td>
		<td width="5" valign="top"></td>
	</tr>
	<tr>
		<td height="5" colspan="3" align="right" valign="top"><img
			src="images/icon1.jpg" width="6" height="5" /></td>
		<td colspan="2" valign="top"><img src="images/icon2.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon3.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td width="7" height="452">&nbsp;</td>
		<td width="5" align="right" valign="top" background="images/icon5.jpg"><img
			src="images/icon5.jpg" width="5" height="5" /></td>
		<td colspan="2" valign="top" bgcolor="#D8EDFF">&nbsp;</td>
		<td valign="top">
		<table width="100%" border="0" cellpadding="0" cellspacing="0"
			bgcolor="#D8EDFF">
			<!--DWLayoutTable-->
			<tr>
				<td height="30" colspan="5" valign="middle"><span class="STYLE1">&nbsp;[人员管理]--&gt;[权限管理]</span></td>
				<td width="35">&nbsp;</td>
			</tr>
			<tr>
				<td height="59" colspan="5" align="center" valign="middle">
					<span class="STYLE8">权限管理</span></td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td width="43" height="74">&nbsp;</td>
                <td width="286" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#5CB7FE">
	              <!--DWLayoutTable-->
	              <tr>
	                <td width="234" height="30" align="center" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1"><strong><strong><strong>模块表</strong></strong></strong></span></td>
                  </tr>
	              <tr>
	                <td height="61" valign="top" bgcolor="#D8EDFF">					
				<div class="dtree">

				<script type="text/javascript">					
					d = new dTree('d');					
					d.add(00,-1,'<input type="checkbox" name="rights" value="" id="1" >'+'所有模块');
					<ww:iterator value="model">
						<ww:if test="fathermodid == null">
							d.add(Number(<ww:property value="modlid"/>),00,'<input type="checkbox"  style="width:14px; height:14px; " name="rights" <ww:property value="flag"/> <ww:if test="checked=='checked'">checked</ww:if> value="<ww:property value="modlid"/>" onclick="selectall_01(this);">&nbsp;&nbsp;'+'<ww:property value="modelname"/>');
						</ww:if>
						<ww:elseIf test="fathermodid!=null">
							d.add(Number(<ww:property value="modlid"/>),Number(<ww:property value="fathermodid"/>),'<input type="checkbox" <ww:if test="checked=='checked'">checked</ww:if> style="width:14px; height:14px; " name="rights" value="<ww:property value="modlid"/>" onclick="selectbox(this);">&nbsp;&nbsp;'+'<ww:property value="modelname"/>','','','right');
						</ww:elseIf> 
					</ww:iterator> 					
					document.write(d);
				</script>
				</div>
					</td>
                  </tr>  
				   </table></td>
	            <td width="142" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
	              <!--DWLayoutTable-->
	              <tr>
	                <td width="118" height="37">&nbsp;</td>
                  </tr>
	              <tr>
	                <td height="51" align="center" valign="middle"><input name="Submit2" type="submit" class="btn1_mouseout" onMouseOver="this.className='btn1_mouseover'"
onMouseOut="this.className='btn1_mouseout'" value="更新权限">
                    &nbsp;</td>
			  </tr>
	              <tr>
	                <td height="4"></td>
                  </tr>
	              
                </table></td>
                <td width="297" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#5CB7FE">
			    <!--DWLayoutTable-->
			    <tr>
			      <td width="401" height="30" align="center" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1"><strong><strong><strong><strong>人员表</strong></strong></strong></strong></span></td>
		        </tr>
			    <tr>
			      <td height="61" valign="top" bgcolor="#D8EDFF">
				<div class="dtree">
				<script type="text/javascript">					
					d1 = new dTree('d');					
					d1.add(00,-1,'所有人员');
					<ww:iterator value="userInfo">						
					d1.add(Number(<ww:property value="Userinfo.userid"/>),00,'<input type="radio"  style="width:14px; height:14px; " name="userid" <ww:property value="Userinfo.flag"/> value="<ww:property value="Userinfo.userid"/>" >&nbsp;&nbsp;'+'<ww:property value="Userinfo.username"/>&nbsp;&nbsp;<ww:property value="realname"/>','rightsShow.action?empid=<ww:property value="Userinfo.userid"/>');
					</ww:iterator> 					
					document.write(d1);
				</script>
				</div>
				  </td>
			    </tr>
	     </table></td>
			  <td width="14">&nbsp;</td>
		      <td></td>
			</tr>
			<tr>
			  <td height="20"></td>
			  <td></td>
			  <td>&nbsp;</td>
			  <td></td>
		  </tr>
			<tr>
			  <td height="269"></td>
			  <td></td>
			  <td></td>
			  <td>&nbsp;</td>
			  <td>&nbsp;</td>
			  <td></td>
		  </tr>
		</table>
		</td>
		<td valign="top" background="images/icon6.jpg"><img
			src="images/icon6.jpg" width="5" height="100%" /></td>
	</tr>



	<tr>
		<td height="5"></td>
		<td valign="top"><img src="images/icon7.jpg" width="5" height="5" /></td>
		<td colspan="3" valign="top"><img src="images/icon8.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon9.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td height="2"></td>
		<td></td>
		<td width="1"></td>
		<td width="6"></td>
		<td></td>
		<td></td>
	</tr>
</table>
</FORM>
</body>
</html>
